Fix order of cairo clip setting when drawing text
authorAlexander Larsson <alexl@redhat.com>
Mon, 31 Aug 2009 14:37:50 +0000 (16:37 +0200)
committerAlexander Larsson <alexl@redhat.com>
Mon, 31 Aug 2009 14:39:54 +0000 (16:39 +0200)
We need to set the window clip region before applying the gc clip region,
otherwise we will reset the gc clip region. Fixes bug 593595

gdk/gdkgc.c

index 13d9c8dab1db74238902bbc806915f7c323cdecc..e721ff5655a8a978f53df49cea470fdad71f56e5 100644 (file)
@@ -1486,6 +1486,10 @@ _gdk_gc_update_context (GdkGC          *gc,
     return;
 
   cairo_reset_clip (cr);
+  /* The reset above resets the window clip rect, so we want to re-set that */
+  if (target_drawable && GDK_DRAWABLE_GET_CLASS (target_drawable)->set_cairo_clip)
+    GDK_DRAWABLE_GET_CLASS (target_drawable)->set_cairo_clip (target_drawable, cr);
+
   if (priv->clip_region)
     {
       cairo_save (cr);
@@ -1501,9 +1505,6 @@ _gdk_gc_update_context (GdkGC          *gc,
       cairo_clip (cr);
     }
 
-  /* The reset above resets the window clip rect, so we want to re-set that */
-  if (target_drawable && GDK_DRAWABLE_GET_CLASS (target_drawable)->set_cairo_clip)
-    GDK_DRAWABLE_GET_CLASS (target_drawable)->set_cairo_clip (target_drawable, cr);
 }